home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / Tiled Views / PaneRowOfWidth.h < prev    next >
Text File  |  2000-06-23  |  668b  |  40 lines

  1. // PaneRowOfWidth.h
  2.  
  3. #ifndef PaneRowOfWidth_h
  4. #define PaneRowOfWidth_h
  5.  
  6. #ifndef PaneRow_h
  7. #include "PaneRow.h"
  8. #endif
  9. #ifndef TiledPane_h
  10. #include "TiledPane.h"
  11. #endif
  12.  
  13. template <uint32 numberOfPanes>
  14. class PaneRowOfWidth: public PaneRow
  15.   {
  16.     private:
  17.         TiledPane basePanes[ numberOfPanes ];
  18.     
  19.     public:
  20.         PaneRowOfWidth()
  21.           {
  22.             for ( uint32 i = 0; i < numberOfPanes; i++ )
  23.                 Add( basePanes[i], afterEnd );
  24.           }
  25.         
  26.         RectangularPane& operator[]( uint32 i )
  27.           {
  28.             Assert( i < numberOfPanes );
  29.             return basePanes[i];
  30.           }
  31.         
  32.         const RectangularPane& operator[]( uint32 i ) const
  33.           {
  34.             Assert( i < numberOfPanes );
  35.             return basePanes[i];
  36.           }
  37.   };
  38.  
  39. #endif
  40.